/**
 * 最简单的分配方式，平均分配逻辑
 */
import * as ws from 'ws';
import * as cws from '../../../lib/net/client-websocket';

export let  _index =0;

export function base(clients:cws.ClientWebSocket[]):cws.ClientWebSocket{
    let len = clients.length;
    if(len==0){
        console.log('gameServer count = 0');
        return;
    }
    if(_index>=len){
        _index = 0;
    }

    let client = clients[_index];
    _index++;
    return client;
}